home *** CD-ROM | disk | FTP | other *** search
- class Instructions extends State
- {
- var nInstructionsPage;
- var sState;
- var mcRef;
- static var sSTATE_IDLE = "Idle";
- static var sSTATE_SHOW = "ShowScreen";
- function Instructions(_mcRef)
- {
- super(_mcRef,false);
- this.nInstructionsPage = 1;
- this.setState(Instructions.sSTATE_IDLE);
- }
- function doShow()
- {
- if(this.sState == Instructions.sSTATE_IDLE)
- {
- this.setState(Instructions.sSTATE_SHOW);
- Main.getRef().doHide();
- this.initPage();
- this.mcRef.mcState.mcScreen.mcPanel.btnPlay1.onRollOver = Delegate.create(Main.getRef(),Main.getRef().rollOverButton);
- this.mcRef.mcState.mcScreen.mcPanel.btnPlay1.onRelease = Delegate.create(Main.getRef(),Main.getRef().clickPlayButton);
- this.mcRef.mcState.stop();
- }
- }
- function doHide()
- {
- if(this.sState != Instructions.sSTATE_IDLE)
- {
- this.setState(Instructions.sSTATE_IDLE);
- Main.getRef().doShow();
- }
- }
- function desactivateButton(_mcButton)
- {
- delete _mcButton.button.onRollOver;
- _mcButton.button.onRollOver = undefined;
- delete _mcButton.button.onRelease;
- _mcButton.button.onRelease = undefined;
- _mcButton.gotoAndStop(2);
- }
- function activateButton(_mcButton, _onRelease)
- {
- _mcButton.gotoAndStop(1);
- _mcButton.button.onRollOver = Delegate.create(Main.getRef(),Main.getRef().rollOverButton);
- _mcButton.button.onRelease = Delegate.create(this,_onRelease);
- }
- function nextPage()
- {
- Controller.getRef().playClickSound();
- this.nInstructionsPage = this.nInstructionsPage + 1;
- this.initPage();
- }
- function previousPage()
- {
- Controller.getRef().playClickSound();
- this.nInstructionsPage = this.nInstructionsPage - 1;
- this.initPage();
- }
- function initPage()
- {
- if(this.nInstructionsPage == 1)
- {
- this.desactivateButton(this.mcRef.mcState.mcScreen.mcPanel.mcBack);
- this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcNext,this.nextPage);
- }
- else if(this.nInstructionsPage == 2)
- {
- this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcBack,this.previousPage);
- this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcNext,this.nextPage);
- }
- else if(this.nInstructionsPage == 3)
- {
- this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcBack,this.previousPage);
- this.desactivateButton(this.mcRef.mcState.mcScreen.mcPanel.mcNext);
- }
- this.mcRef.mcState.mcScreen.mcPanel.mcPage.gotoAndStop(this.nInstructionsPage);
- }
- function doPause()
- {
- }
- function doUnPause()
- {
- }
- function Idle()
- {
- }
- function ShowScreen()
- {
- }
- }
-